import Vue from 'vue';
import Vuex from 'vuex';
import mediaBook from './modules/mediaBook';
import mediaTheme from './modules/mediaTheme';
import recommend from './modules/recommend';
import bookCircle from './modules/bookCircle';
import article from './modules/article';
import series from './modules/series';

Vue.use(Vuex);

export default new Vuex.Store({
	modules: {
		mediaBook,
		mediaTheme,
		recommend,
		circle: bookCircle,
		article,
		series
	},
	state: {
		count: 0,
		userInfo: null,
		sportList: [],
		menuSport: [],
		authority: [],
		xDataVisible: false
	},
	mutations: {
		updateUser(state, userInfo) {
			state.userInfo = userInfo;
		},
		setSportList(state, data) {
			state.sportList = data;
		},
		updateAuthority(state, data) {
			state.authority = data;
		},
		setMenuSport(state, data) {
			state.menuSport = data;
		}
	}
});
